<template>
  <div>
    <img v-for="item in arr" :key="item.id" :src="$pre+item.img" alt="">
  </div>
</template>

<script>
import axios  from 'axios'
export default {
data(){
  return{
    //初始化数据
    arr:[]
  }
},
mounted(){
  axios({
    url:"api/getbanner",
    method:"get"
  }).then(res=>{
    //console.log(res)
  this.arr=res.data.list  
  })
}
}
</script>

<style lang="less" scoped>
@import "../../../less/index.less";
img {
  width: 100vw;
}
</style>